<?php define('SIDEBAR', TRUE);?>
<?php /* 
Template Name: (04) Page with links athletes
*/ ?>
<?php get_header(); ?>

<h2>Utøvere med blog eller hjemmeside</h2>

<?php
global $wpdb;   // Give wpdb with global scope

$sql = "SELECT athlete.name, athlete.url
	FROM athlete 
	WHERE athlete.url like '%http%' 
	order by athlete.name asc"; 

$results = $wpdb->get_results($sql);
?>
<dl class="athlete-links">
<?php foreach($results as $result): ?>
	<dt><?php echo $result->name; ?></dt>
	<dd><cite>
		<a href="<?php echo $result->url; ?>" target="_blank" rel="homepage" title="Gå til <?php echo $result->name; ?>'s hjemmeside"><?php echo $result->url; ?></a>
	</cite></dd>
<?php endforeach; ?>
</dl>
	
<?php get_footer(); ?>